//
// Created by lyc on 2025/2/23.
//
#include "iostream"
using namespace std;

int stepCounter(int inputNumber){
    /**
     * 计算需要多少步
     * 输入 inputNumber: 待计算的自然数
     * 输出 所需步数
     */
     int count = 0;

     while(inputNumber != 1){
         if(inputNumber % 2 == 0)
             inputNumber = inputNumber / 2;     //偶数:除以2
         else
             inputNumber = (inputNumber * 3 + 1) / 2;       //奇数:3n+1 除以2
         count++;
     }

     return count;
}

int algorithm1(){
    int input;

    cout << "input : ";
    cin >> input;
    cout << "need " <<stepCounter(input) << " step" <<endl;

    return 0;
}